package org.example.design.bridge.channel;

import org.example.design.bridge.mode.IPayMode;

import java.math.BigDecimal;

/**
 * @Classname WxPay
 * @Description TODO
 * @Date 2020/11/3 3:05 下午
 * @Created by xiangjd
 */
public class WxPay extends Pay {

    public WxPay(IPayMode iPayMode) {
        super(iPayMode);
    }

    @Override
    public String transfer(String uid, String tradeId, BigDecimal acmount) {

        logger.info("模拟微信渠道支付划账开始。uId：{} tradeId：{} amount：{}", uid, tradeId, acmount);
        boolean security = iPayMode.isSecurity(uid);
        logger.info("模拟微信渠道支付风控开始。uId：{} tradeId：{} amount：{}", uid, tradeId, acmount);
        if (!security) {
            logger.info("模拟微信渠道支付划账拦截。uId：{} tradeId：{} amount：{}", uid, tradeId, acmount);
            return "0001";
        }
        logger.info("模拟微信渠道支付划账成功。uId：{} tradeId：{} amount：{}", uid, tradeId, acmount);

        return "1111";
    }
}
